package com.xmy.study.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * <p>
 * 帐号
 * </p>
 *
 * @author hpiggy
 * @since 2023-09-08
 */
@Data
@TableName("per_student_account")
@ApiModel(value = "StudentAccount对象", description = "帐号")
public class StudentAccount implements Serializable {

    private static final long serialVersionUID = 1L;

    @ExcelIgnore
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ExcelIgnore
    private Long schoolId;

    @ExcelIgnore
    private Long studentId;

    @ExcelProperty(index = 0,value = "姓名")
    @ApiModelProperty("学生姓名")
    private String studentName;

    @ApiModelProperty("0禁用，1正常，2试用")
    private Integer status;

    @ExcelProperty(index = 1,value = "账号")
    private String account;

    @ExcelProperty(index = 2,value = "密码")
    private String pwd;

    @ApiModelProperty("年份")
    private Integer yearPart;

    @ExcelIgnore
    @ApiModelProperty("学期")
    private Integer quarterNum;

    @ExcelIgnore
    @ApiModelProperty("年级")
    private Integer yearClassId;

    @ExcelIgnore
    @ApiModelProperty("1学生，2教师")
    private Integer accountType;

    @ExcelIgnore
    @ApiModelProperty("精品课所在班级id")
    private Long gradeId;

    @ExcelIgnore
    @ApiModelProperty("班型id")
    private Long classTypeId;

    private Long beforeClassTypeId;

    @ExcelIgnore
    @ApiModelProperty("试用帐号的到期日期")
    private LocalDate tryOutEndDate;

    @ExcelIgnore
    private Integer switchPk;

    @ExcelIgnore
    @ApiModelProperty("1精品课学生自动生成，2手动添加")
    private Integer addType;

    @ExcelProperty(index = 4,value = "注册时间")
    @ApiModelProperty("添加时间")
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdAt;

    @ExcelIgnore
    @ApiModelProperty("是否删除，0正常，1删除")
    @TableLogic(value = "0", delval = "1")
    @TableField(select = false)
    private Integer deleted;

    @ExcelProperty(index = 3,value = "年级")
    @TableField(exist = false)
    private String yearClassStr;

    @ExcelProperty(index = 4,value = "班型")
    @TableField(exist = false)
    private String classTypeStr;


}
